//
//  NSDate+BaseFramework.h
//  Project
//
//  Created by Suny on 14-10-25.
//  Copyright (c) 2014年 Suny. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSDate (BaseFramework)

- (NSUInteger)daysAgo;
- (NSUInteger)daysAgoAgainstMidnight;
- (NSString *)stringDaysAgo;
- (NSString *)stringDaysAgoAgainstMidnight:(BOOL)flag;
- (NSUInteger)weekday;

+ (NSDate *)systemTime;
+ (NSDate *)dateFromString:(NSString *)string;
+ (NSDate *)dateFromString:(NSString *)string withFormat:(NSString *)format;
+ (NSDate *)dateFromStringNoSec:(NSString *)string;
+ (NSDate *)dateFromTimestamp:(NSNumber *)timestamp;
+ (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)string;
+ (NSString *)stringFromDate:(NSDate *)date;
+ (NSString *)stringForDisplayFromDate:(NSDate *)date;
+ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed;
+ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed alwaysDisplayTime:(BOOL)displayTime;


- (NSDateComponents *)dateComponents;

/* 年月日 */
- (NSString *)day;
- (NSString *)month;
- (NSString *)year;
- (NSString *)week;
- (NSInteger)hour;

- (BOOL)isTheSameDayCompareWithDate:(NSDate *)date;

- (NSString *)string;
- (NSString *)stringWithFormat:(NSString *)format;
- (NSString *)stringWithDateStyle:(NSDateFormatterStyle)dateStyle timeStyle:(NSDateFormatterStyle)timeStyle;
- (NSString *)stringWithNewsDateFormat;
- (NSString *)stringWithDateFormat;
- (NSString *)stringWithTimeStampNoSecFormat;
- (NSString *)stringWithDateAndTime;

- (NSDate *)beginningOfWeek;
- (NSDate *)beginningOfDay;
- (NSDate *)endOfWeek;

+ (NSString *)dateFormatString;
+ (NSString *)timeFormatString;
+ (NSString *)timestampFormatString;
+ (NSString *)timestampWithoutSecondFormatString;
+ (NSString *)dbFormatString;

+(NSString*)dateAndtimesFormatString;

// 评论时间显示
- (NSString *)commonDateString;

//显示时间间隔
- (NSString*)stringFromDateToSubscribe;


@end
